<?php
class XmlFetcher{

    private static $instance = null;

    final static function getInstance() {
        if (self::$instance == null){
            self::$instance = new XmlFetcher();
        }
        return self::$instance;
    }

    private function __construct(){}

    public function getXml($file){
        return simplexml_load_file("../xml/" . $file);
    }

    public function setXml($xml, $file){
        $file = fopen("../xml/" . $file, "w");
        fwrite($file, $xml->saveXML());
        fclose($file);
    }
}
